<!--
 * @FilePath     : /study_code/jquery/index copy.html
 * @Description  : $(selector).on() 添加事件监听
 * @Date         : 2025-04-21 10:29:45
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-04-21 10:29:50
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <!-- <link rel="stylesheet" href="" /> -->
  </head>
  <body>
    <ul>
      <li>子项1</li>
      <li>子项2</li>
      <li>子项3</li>
      <li>子项4</li>
      <li>子项5</li>
      <li>子项6</li>
    </ul>

    <script src="/jquery/dist/jquery.min.js"></script>
    <script>
      $('ul').on('click', 'li', function () {
        console.log($(this).html())
      })
      /*
    注意：
    这里选择器条件会自动将父级拼接上，条件为	'ul>li'
    如果参数是	'ul>li'，拼接上结果就为	'ul>li>li'
    */
    </script>
  </body>
</html>
